const app = getApp()

Page({
  data: {
    cndUrl: app.domainName,
    tipNum:0,
    mico:'',
    indexC1:{1:'animated fadeIn',2:'hide'}
  },
  onLoad: function () {
    var _this=this;
    getApp().mtj.trackEvent('home');
    setTimeout(function(){
       _this.setTong('首页',"进入首页");
    }, 2000); 
  },
  openqi: function(e){
    wx.redirectTo({url: '/pages/zhan/index'});
    return;
    var _id=e.currentTarget.dataset.id;
    var _this=this;
      this.setData({indexC1:{1:'hide',2:'animated fadeIn'}});
      setTimeout(function(){
        _this.setData({indexC1:{1:'animated fadeIn',2:'hide'}});
      }, 1200);
      getApp().mtj.trackEvent('home_xszl');
      this.setTong('首页',"线上展览");
    
  },
  goyusu:function(){
    this.setTong('首页',"艺术疗愈按钮"); 
    getApp().mtj.trackEvent('home_yslybtn');
    wx.redirectTo({url: '/pages/class/index'});
  },
  openMusci: function(){
    if(true == app.misP){
      app.misP=false;
      this.setData({mico:2});
      app.pauseBGM();
    }else{
      app.misP=true;
      app.replayBGM();
      this.setData({mico:''});
    }
  },
  setTong(_id,_name){
    wx.request({
      url: app.domainName + 'web/?c=bai',
      method: 'POST',
      data: {op:app.globalData.openid, id:_id,name:_name
      }, header: { 'content-type': 'application/x-www-form-urlencoded' },
      success: function (res) {  }
    });
  },
  onShareAppMessage: function (e) {
    var _imgUrl=app.domainName+'img/65.png';
    this.setTong('分享朋友圈', 'home');
    getApp().mtj.trackEvent('home_share');
      return {
        title: '【没有谁是一座孤岛】保时捷公共艺术疗愈展览',
        imageUrl:_imgUrl,
        path: '/pages/index/index'
      }
}
})
